﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuanLyCauHoi.ascx.cs" Inherits="Main.Administrator.QuanLyCauHoi" %>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<div id="Location" class="Location" runat="server"><a href="../Administrator.aspx">Administrator Page</a> >> Quản lý Câu Hỏi</div>
<div id="Notice" class="Notice" runat="server" visible="false"></div>
<div id="Errors" class="Errors" runat="server" visible="false"></div>
<div id="Form">
    <div runat="server" id="pBoLoc" visible="false">
        <table width="100%" cellspacing="5">
        <tr>
            <td style="height: 38px">
                <asp:DropDownList ID="ddlChuyenMuc" runat="server" AutoPostBack="true" Width="100%" OnSelectedIndexChanged="ddlChuyenMuc_SelectedIndexChanged">
                </asp:DropDownList></td>
            <td style="height: 38px">
                <asp:DropDownList ID="ddlMucDo" runat="server" AutoPostBack="true" Width="100%" OnSelectedIndexChanged="ddlMucDo_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td style="height: 38px">
                <asp:DropDownList ID="ddlKyNang" runat="server" AutoPostBack="true" Width="100%" OnSelectedIndexChanged="ddlKyNang_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td style="height: 38px">
                <asp:DropDownList ID="ddlLoaiCauHoi" runat="server" AutoPostBack="true" Width="100%" OnSelectedIndexChanged="ddlLoaiCauHoi_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td style="height: 38px">
                <input type="text" style="width:100%" value="Tìm kiếm theo nội dung..." id="txtSearch" runat="server" onfocus="if(this.value=='Tìm kiếm theo nội dung...') this.value='';this.style.backgroundColor = '#A2D2EA';" onblur="if(this.value=='') this.value='Tìm kiếm theo nội dung...';this.style.backgroundColor = '#FFFFFF';"  />
            </td>
            <td style="height: 38px">&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="lnkFilter" runat="server" OnClick="lnkFilter_Click" ><asp:Image ID="imgFind" runat="server" SkinID="Find" /></asp:LinkButton></td>
        </tr>
        </table>
    </div>
     <div style="float:right;" runat="server" id="pBack">
         <asp:LinkButton ID="lnkBack" runat="server" OnClick="lnkBack_Click" ToolTip="Trở về danh sách câu hỏi" ><asp:Image ID="imgBack" runat="server" SkinID="Back" /></asp:LinkButton></td>
     </div>
     <div style="clear:both; "></div>
    <div runat="server" id="pNoiDungCauHoiCha"></div>
    <div id="pMain" runat="server">
        <asp:Label ID="lblTieuDe" runat="server"></asp:Label>
        <asp:HiddenField ID="hidID" runat="server" Value="" />
        <asp:GridView SkinID="GridViewSkin" ID="gridCauHoi" runat="server"   DataKeyNames="DanhSachDapAn,MaCauHoi" 
         AutoGenerateColumns="False" OnPageIndexChanging="gridCauHoi_PageIndexChanging" 
            AllowPaging="True" OnRowDeleting="gridCauHoi_RowDeleting" OnRowEditing="gridCauHoi_RowEditing" OnLoad="gridCauHoi_Load" AllowSorting="True" OnSorting="gridCauHoi_Sorting" OnRowDataBound="gridCauHoi_RowDataBound" >
            <Columns>
                <asp:TemplateField ItemStyle-Width="5%">
                    <HeaderTemplate >
                        <asp:CheckBox ID="chkAll" runat="server" OnCheckedChanged="chkAll_CheckedChanged" AutoPostBack="True" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="chkChon" runat="server"  type="checkbox" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="ID" ItemStyle-Width="7%" SortExpression="MaCauHoi" >
                    <itemtemplate>
                        <asp:Label id="lblMaCauHoi" runat="server" Text='<%# Eval ( "MaCauHoi" ) %>'></asp:Label> 
                    </itemtemplate>
                    <FooterTemplate>
                        <asp:CheckBox ID="chkAll" runat="server" />
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="40%" HeaderText="Nội dung" SortExpression="NoiDung">
                    <itemtemplate>
                        <asp:Label id="lblNoiDung" Text='<%# GenerateTooltip((int)Eval("MaCauHoi"),(string)Eval("NoiDung"),(object)Eval("DanhSachDapAn"), (int)Eval("CauHoiCha")) %>' runat="server" ></asp:Label> 
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="10%" HeaderText="Mức độ" SortExpression="MucDo">
                    <itemtemplate>
                        <asp:Label id="lblMucDo" runat="server"  Text='<%# Eval ( "MucDo.TenMucDo" ) %>'></asp:Label>
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="10%" HeaderText="Kỹ năng" SortExpression="KyNang">
                    <itemtemplate>
                        <asp:Label id="lblKyNang" runat="server"   Text='<%# Eval ( "KyNang.TenKyNang" ) %>'></asp:Label>               
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField ItemStyle-Width="20%" HeaderText="Chuy&#234;n mục" SortExpression="ChuyenMuc">
                    <itemtemplate>
                        <asp:Label id="lblChuyenMuc" runat="server"  Text='<%# Eval ( "ChuyenMuc.TenChuyenMuc" ) %>'></asp:Label>    
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Thao t&#225;c">
                    <itemtemplate>
                        <asp:LinkButton id="lnkEdit" runat="server"  ToolTip="Sửa" CommandName="Edit" >
                            <asp:Image ID="imgEdit" runat="server" SkinID="Edit" />
                        </asp:LinkButton><asp:LinkButton id="lnkDelete" runat="server" CommandName="Delete"   ToolTip="Xóa" OnClientClick="return confirm('Bạn có muốn xóa thật không?');">
                            <asp:Image ID="imgDelete" runat="server" SkinID="Delete" />
                        </asp:LinkButton>         
                    </itemtemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <br />
        <label><b>Bulk Action</b>: </label>
        <asp:LinkButton runat="server" CssClass="Button2" id="lnkDeleteAll" Text="Xóa" OnClientClick="return confirm('Bạn có muốn xóa thật không?');" OnClick="lnkDeleteAll_Click"></asp:LinkButton>
         &nbsp;
    </div>
</div>
</ContentTemplate>
</asp:UpdatePanel>

<asp:Image ID="imgAsc" runat="server" SkinID="ASC" Visible="false" />
<asp:Image ID="imgDesc" runat="server" SkinID="DESC" Visible="false" />
<asp:Image ID="imgSave" runat="server" SkinID="Save" Visible="false" />
     
     
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
       <ProgressTemplate>
                <div class="overlay" id="divProgress" style="position: absolute">
                    <center>
                        <asp:Image runat="server" ID="AjaxLoading" SkinID="AjaxLoadingIndicator" />
                    </center>
                </div>
        </ProgressTemplate>
</asp:UpdateProgress>
